{% extends 'base.html' %}
{% block styles%}
<style type="text/css">
    header{
        background-color: #eee;
        height: 7rem;
    }
    header h1{
        font-size: 3rem;
    }
    .mynav{
        margin-bottom: 0 !important;
    }
    .mybtn{margin: 20px 0px}
    th{background-color: #eee;}
</style>
 {% endblock %}
 {% block title%}
    <title>主界面</title>
{% endblock %}
{% block nav %}
    <li><a href="/logout"><span class="glyphicon glyphicon-log-out"></span> 退出登录</a></li>
{% endblock %}
{% block content %}
<header>
<div class="container">
    <h1>教师管理</h1>
</div>
</header>
<!-- 按钮组 -->

<div class="container mybtn">

<a href="/add_teacher" class="btn btn-info">
          <span class="glyphicon glyphicon-plus"></span> 添加
        </a>

</div>
<!-- 表格 -->
<div class="container table-responsive text-center">
<table class="table table-bordered table-hover">
  <caption>边框表格布局</caption>
  <thead class="text-center">
    <tr>
      <th class="text-center">名称</th>
      <th class="text-center">简介</th>
      <th class="text-center">level</th>
      <th class="text-center">编辑</th>
      <th class="text-center">删除</th>
  
    </tr>
  </thead>
  <tbody>
    {% for item in teachers %}
    <tr>
      <td>{{item.name}}</td>
      <td>{{item.abstract}}</td>
      <td>{{item.level}}</td>
      <td>
          <a href="/edit_teacher?id={{item.id}}">
            <span class="glyphicon glyphicon-edit"></span>
        </a>
      </td>
      <td>
          <a href="#" onclick="removeteacher('{{item.id}}','{{item.name}}')">
            <span class="glyphicon glyphicon-trash"></span>
          </a>
      </td>
    </tr>
    {% endfor %}
  </tbody>
  </div>
  <!-- 表格外边模态框 -->
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" id="myModalLabel">确定要删除吗</h4>
            </div>
            <div class="modal-body">在这里添加一些文本</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary remove">提交更改</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
{% endblock %}
{% block script %}
<!-- {{url_for('static',filename='courses')}} -->
<script type="text/javascript" src="/static/teacher.js" id='jss'></script>
{% endblock %}
